package com.common.exception;


/**
 * DAO层异常处理
 * 
 * @author fitch
 * @createtime 2012-12-14 下午5:24:38
 * @version 1.0
 */
public class DAOException extends BaseException {

	private static final long serialVersionUID = 1L;

	public DAOException() {
		super();
	}

	/**
	 * @param e
	 */
	public DAOException(Exception e) {
		if (e instanceof BaseException) {
			this.setSuperException((BaseException) e);
		} else {
			setException(e);
			setErrorLevel(DAOLEVEL);
			setDetailMessage(DAOERRORINFO);
			
		}
	}

	/**
	 * @param e
	 * @param className
	 */
	public DAOException(Exception e, String className) {
		if (e instanceof BaseException) {
			this.setSuperException((BaseException) e);
		} else {
			setException(e);
			setErrorLevel(DAOLEVEL);
			setDetailMessage(DAOERRORINFO);
			
		}
	}

	/**
	 * @param e
	 * @param c
	 */
	public DAOException(Exception e, Class<?> c) {
		if (e instanceof BaseException) {
			this.setSuperException((BaseException) e);
		} else {
			setException(e);
			setErrorLevel(DAOLEVEL);
			setDetailMessage(DAOERRORINFO);
			
		}
	}

}
